import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  
  {
    title: '信息来源',
    align: "center",
    dataIndex: 'infoRes'
  },
  {
    title: '标题',
    align: "center",
    dataIndex: 'title'
  },
  {
    title: '作者',
    align: "center",
    dataIndex: 'author'
  },
  {
    title: '文章类型',
    align: "center",
    dataIndex: 'categorycode'
  },
  {
    title: '是否首页显示',
    align: "center",
    dataIndex: 'ishome',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'1'},{text:'否',value:'0'}]);
     },
  },
  {
    title: '是否图片新闻',
    align: "center",
    dataIndex: 'ispics',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'1'},{text:'否',value:'0'}]);
     },
  },
  {
    title: '是否显示',
    align: "center",
    dataIndex: 'isshow',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'1'},{text:'否',value:'0'}]);
     },
  },
  {
    title: '文章形式',
    align: "center",
    dataIndex: 'articleXsh'
  },
  {
    title: '外链地址',
    align: "center",
    dataIndex: 'articleAddress'
  },
  {
    title: '副题',
    align: "center",
    dataIndex: 'subtitle'
  },
  {
    title: '头图是否显示',
    align: "center",
    dataIndex: 'imgisshow',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'1'},{text:'否',value:'0'}]);
     },
  },
  {
    title: '创建日期',
    align: "center",
    dataIndex: 'createTime'
  },
  {
    title: '更新日期',
    align: "center",
    dataIndex: 'updateTime'
  },
];

// 高级查询数据
export const superQuerySchema = {
  createTime: {title: '创建日期',order: 0,view: 'datetime', type: 'string',},
  updateTime: {title: '更新日期',order: 1,view: 'datetime', type: 'string',},
  infoRes: {title: '信息来源',order: 2,view: 'text', type: 'string',},
  title: {title: '标题',order: 3,view: 'text', type: 'string',},
  author: {title: '作者',order: 4,view: 'text', type: 'string',},
  categorycode: {title: '文章类型',order: 5,view: 'popup', type: 'string',code: 'article_type_dict', orgFields: 'article_type', destFields: 'categorycode', popupMulti: false,},
  ishome: {title: '是否首页显示',order: 7,view: 'number', type: 'number',},
  ispics: {title: '是否图片新闻',order: 8,view: 'number', type: 'number',},
  isshow: {title: '是否显示',order: 9,view: 'number', type: 'number',},
  articleXsh: {title: '文章形式',order: 12,view: 'text', type: 'string',},
  articleAddress: {title: '外链地址',order: 13,view: 'text', type: 'string',},
  subtitle: {title: '副题',order: 18,view: 'text', type: 'string',},
  imgisshow: {title: '头图是否显示',order: 19,view: 'switch', type: 'string',},
};
